package old.bridge;

//抽象的电脑类型
public abstract class Computer  {
    protected Brand brand;

    //组合品牌 --- 桥
    public Computer(Brand brand) {
        this.brand = brand;
    }

    String info(){
        return brand.info();
    }

    @Override
    public String toString() {
        return info();
    }
}

class DeskTop extends Computer {

    public DeskTop(Brand brand) {
        super(brand);
    }

    @Override
    String info() {
        return super.info() + "台式机";
    }

}

class LapTop extends Computer {
    public LapTop(Brand brand) {
        super(brand);
    }
    @Override
    String info() {
        return super.info() + "笔记本";
    }

}